http://tecadmin.net/download-upload-files-using-ftp-command-line/

How to Download and Upload Files using FTP Command Line

FTP (File Transfer Protocol) is the most popular protocol to transfer files (download and upload) from one system to other system. It provides the fastest way transfer files. There are many application available on Linux and windows to FTP services like vsftpd, proftpd for Linux, FileZilla Server for windows.

There are various ways to connect to ftp server, Also you can find multiple free tools on internet to work with ftp. But system admins know the power of command line. This article will help you to how to connect to FTP server using command line and Download and Upload Files using FTP protocol between FTP server local system.

1. Connect to FTP Server via Command Line

To connect to any FTP server from windows open its command prompt and for Linux open terminal window. Now you have required IP or Hostname of FTP server and login credentials to connect with specific user.

c:> ftp ftp.tecadmin.net

ftp-connect-from-commandline

2. Upload Single File to FTP Server

To upload file on FTP server use put command from ftp prompt. First navigate to desired directory on ftp server where to upload file and use following command. It will upload local system file c:filesfile1.txt to uploads directory on ftp server.

ftp> cd uploads
ftp> put c:filesfile1.txt

ftp-upload-single-file

3. Download Single File from FTP Server

To download file from FTP server, we use get command. Using that command we can download one time at a time. To download any file from ftp server, first login to your ftp server, navigate to directory and use following command to download

ftp> get file1.txt

ftp-download-single-file

4. Upload Multiple Files to FTP Server

To upload multiple files to FTP server we use mput command from ftp prompt. We can specify wild card character to upload multiple files to server at a time. First navigate to desired directory on ftp server where to upload file and use following command. It will upload local system files with .txt extension in c:files directory to uploads directory on ftp server.

ftp> cd uploads
ftp> lcd c:files

ftp> put *.txt

ftp-multiple-file-upload

5. Download Multiple Files from FTP Server

To download multiple files from FTP server, we use mget command. Using that command we can download more than one files at a time. To download multiple files specify wild card character for specify directory name do download all files from directory.

ftp> mget *.txt

ftp-multiple-file-download


upload a file to a server via FTP using R


library(RCurl)
ftpUpload("Localfile.html", "ftp://User:Password@FTPServer/Destination.html")


Where Localfile.html is the file to be uploaded, User indicates the user name and Password the password to log into the server while FTPServer is a placeholder for the server name and possible path to use while last but not least Destination.html is an example of the name the to be uploaded file gets on the server.

If you can access it from the command line, then you can do:

system("ftp ...") # where ... is the argument list

You could easily wrap this in an R function if you plan on doing it often.

http://tecadmin.net/download-upload-files-using-ftp-command-line/#
Download and Upload Files using FTP Command Line